#include "project/initialization.h"

void
drawPlyModel(PlyModel* ply_model)
{
	// Centraliza o modelo ativo
	glTranslatef(
		-(ply_model->bc_coords->xm*zoom),
		-(ply_model->bc_coords->ym*zoom),
		-(ply_model->bc_coords->zm*zoom)
	);
		
	// Desenha o modelo 
	glBegin(GL_POINTS);
		glColor3f(red, green, blue);
		for (i = 0; i < ply_model->num_faces; i++)
			for (j = 0; j < 3; j++)
				glVertex3f(
					ply_model->vlist[ ply_model->flist[i]->verts[j] ]->x*zoom,
					ply_model->vlist[ ply_model->flist[i]->verts[j] ]->y*zoom,
					ply_model->vlist[ ply_model->flist[i]->verts[j] ]->z*zoom
				);
	glEnd();
}

void
drawWorldAxis(void)
{
	/* Desenha eixos cartesianos */
	
	glBegin(GL_LINES);
		glColor3f(1.0f, 0.0f, 0.0f);
		glVertex3f(-100.0f, 0.0f, 0.0f);
		glVertex3f(100.0f, 0.0f, 0.0f);

		glColor3f(0.0f, 1.0f, 0.0f);
		glVertex3f(0.0f, -100.0f, 0.0f);
		glVertex3f(0.0f, 100.0f, 0.0f);

		glColor3f(0.0f, 0.0f, 1.0f);
		glVertex3f(0.0f, 0.0f, -100.0f);
		glVertex3f(0.0f, 0.0f, 100.0f);
	glEnd();
}
